package com.ct.gd.passport.domain;

import java.sql.Date;

import com.ct.gd.passport.common.connect.CtServer;
import com.ct.gd.passport.common.constants.Config;
import com.ct.gd.passport.common.constants.Protocol;
import com.fuckhtc.gson.Gson;
import com.fuckhtc.gson.annotations.SerializedName;
import com.up91.common.android.connect.Params;

public class AdviceDetail {

	@SerializedName("id")
	private int												id;
	
	@SerializedName("title")
	private String											title;
	
	@SerializedName("content")
	private String											submitContent;
	
	@SerializedName("replyContent")
	private String											replyContent;
	
	@SerializedName("addTime")
	private long											addTime;
	
	@SerializedName("replyTime")
	private long											replyTime;
	
	@SerializedName("replyPerson")
	private String											replyPerson;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}
	
	public String getSubmitTime() {
		return new Date(addTime).toString();
	}

	public String getSubmitContent() {
		return submitContent;
	}

	public String getReplyTime() {
		return new Date(replyTime).toString();
	}

	public String getReplyPerson() {
		return replyPerson;
	}

	public String getReplyContent() {
		return replyContent;
	}

	public static AdviceDetail  load(int adviceId){
		Params params = new Params();
		params.put(Protocol.Fields.ADIVCE_ID, adviceId);
		if(Config.ON_LINE){
			String json = CtServer.getServer().doGet(Protocol.Commands.ADVICE_DETAIL, params);
			return new Gson().fromJson(json, AdviceDetail.class);
		}
		
		AdviceDetail info = new AdviceDetail();
//		info.title = "有哪些优惠信息";
//		info.updateTime = "2012-06-05";
//		info.submitTime = "有哪些优惠信息";
//		info.ReplyTime("2012-06-06");
//		info.setReplyPerson("客服专员");
//		info.setReplyContent("您好,我们有最新的旅游目的地的优惠信息,分为VIP和非VIP部分");
		return info;
	}
}
